package com.df.ez_game.server.req_metadata;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.esotericsoftware.reflectasm.MethodAccess;
import lombok.Data;

@Data
public class EzMethodData {
    private String methodName = "";
    private String methodDesc = "";
    private Integer methodId = 0;
    private Integer methodFullId = 0;

    private String paramName;
    private Class paramType;
    private boolean paramIsBaseType = false;
    private Class paramWrapperType;
//    private Codec paramCodec;
    //TODO 换成业务消息编解码器，可以随意设置，默认提供json和protobuf
//    private IEzGameBusinessMsgCodec paramCodec;

    private Class returnType;
    private boolean returnIsBaseType = false;
    private Class returnWrapperType;
//    private Codec returnCodec;

    MethodAccess methodAccess;
    Object instance;
    int methodIndex = 0;

    public Object invoke(Object... args){
        return methodAccess.invoke(instance,methodIndex,args);
    }
}
